 CREATE  FUNCTION fn_ct_get_gpItemNumber( @partNumber VARCHAR(50), @processType VARCHAR(50), @baseProcessType VARCHAR(50) )
 RETURNS VARCHAR(31) AS
 BEGIN
 	DECLARE @gp_itemNumber VARCHAR(31)
 	SET @gp_itemNumber = ''
 	IF @baseProcessType = 'Finished Goods'
 	BEGIN
 		SET @gp_itemNumber = SUBSTRING( @partNumber, 1, 25 ) --+ '/' + SUBSTRING( @processType, 1, 5 )
 	END
 	ELSE
 	BEGIN
 		IF @processType = 'Wafer Store'
 		BEGIN
 			SET @gp_itemNumber = SUBSTRING( @partNumber, 1, 25 ) + '/' + 'WS'
 		END
 		ELSE
 		BEGIN
 			SET @gp_itemNumber = SUBSTRING( @partNumber, 1, 25 ) + '/' + SUBSTRING( @processType, 1, 5 )
 		END
 	END		
 	RETURN @gp_itemNumber
 END